package cn.rwklyd.BookKeeping.service;

import cn.rwklyd.BookKeeping.pojo.Result;
import cn.rwklyd.BookKeeping.pojo.Transaction;
import cn.rwklyd.BookKeeping.pojo.vo.TransactionPageVO;
import cn.rwklyd.BookKeeping.pojo.vo.TransactionVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.time.LocalDateTime;
import cn.rwklyd.BookKeeping.pojo.vo.TransactionStatsVO;

public interface TransactionService extends IService<Transaction> {
    
    Result<Long> addTransaction(Transaction transaction);
    
    Result<String> deleteTransaction(Long id);
    
    Result<String> updateTransaction(Transaction transaction);
    
    Result<Transaction> getTransactionById(Long id);
    
    Result<IPage<Transaction>> getTransactionList(Integer page, Integer pageSize);
    
    Result<IPage<Transaction>> queryTransactions(Long id, Long userId, Long categoryId, 
                                              Long platformId, LocalDateTime startDate, 
                                              LocalDateTime endDate, String remark, 
                                              Integer page, Integer pageSize);
    
    // 新增带有分类和平台信息的查询方法
    Result<TransactionVO> getTransactionVOById(Long id);
    
    Result<TransactionPageVO> getTransactionVOList(Integer page, Integer pageSize);
    
    // 修改返回类型，包含统计数据
    Result<TransactionPageVO> queryTransactionVOs(Long id, Long userId, Long categoryId, 
                                              Long platformId, LocalDateTime startDate, 
                                              LocalDateTime endDate, String remark, 
                                              Integer page, Integer pageSize);

    /**
     * 获取用户记账统计信息
     * @return 用户记账统计信息
     */
    Result<TransactionStatsVO> getUserTransactionStats();

    /**
     * 更新收支凭证图片
     * @param id 收支记录ID
     * @param receiptImage 凭证图片URL
     * @return 更新结果
     */
    Result<String> updateReceiptImage(Long id, String receiptImage);
} 